package com.example.hystrix;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.web.bind.annotation.RequestMapping;

@org.springframework.web.bind.annotation.RestController
public class RestController {
    @RequestMapping("test")
    @HystrixCommand(fallbackMethod = "fallback")
    public String test() {
        if(true){
            throw new RuntimeException();
        }
        return "test";
    }

    public String fallback() {
        return "from the fallback";
    }
}
